home *** CD-ROM | disk | FTP | other *** search
- import java.util.Random;
- import javax.microedition.lcdui.Canvas;
- import javax.microedition.lcdui.Graphics;
- import javax.microedition.lcdui.Image;
-
- // $FF: renamed from: e
- class class_0 {
- // $FF: renamed from: new int
- public static final int field_0 = 1;
- // $FF: renamed from: i int
- public static final int field_1 = 2;
- // $FF: renamed from: c java.util.Random
- private static final Random field_2 = new Random();
- // $FF: renamed from: long javax.microedition.lcdui.Image[]
- private static final Image[] field_3 = new Image[4];
- // $FF: renamed from: char javax.microedition.lcdui.Image[]
- private static final Image[] field_4 = new Image[4];
- // $FF: renamed from: byte byte[]
- private static byte[] field_5;
- // $FF: renamed from: case int[]
- private static int[] field_6;
- // $FF: renamed from: f a
- private final a field_7;
- // $FF: renamed from: g int
- private final int field_8;
- // $FF: renamed from: a int
- private final int field_9;
- // $FF: renamed from: e int
- private final int field_10;
- // $FF: renamed from: b int
- private final int field_11;
- // $FF: renamed from: try int
- private int field_12;
- // $FF: renamed from: for int
- private int field_13;
- // $FF: renamed from: if int
- private int field_14;
- // $FF: renamed from: h int
- private int field_15;
- // $FF: renamed from: goto int
- private int field_16;
- // $FF: renamed from: else int
- private int field_17;
- // $FF: renamed from: int int
- private int field_18;
- // $FF: renamed from: d int
- private int field_19;
- // $FF: renamed from: do boolean
- private boolean field_20 = false;
- // $FF: renamed from: null javax.microedition.lcdui.Image
- private Image field_21;
- // $FF: renamed from: void byte
- private byte field_22;
-
- public class_0(a var1, int var2) {
- this.field_7 = var1;
- this.field_8 = (((Canvas)var1).getWidth() - 8) / 3;
- this.field_9 = (((Canvas)var1).getHeight() - 20) / 3;
- this.field_10 = (((Canvas)var1).getWidth() - this.field_8 * 3) / 2;
- this.field_11 = 10;
- this.field_12 = var2;
- if (this.field_12 == 1) {
- this.field_21 = field_3[0];
- } else {
- this.field_21 = field_4[0];
- }
-
- if (field_5 == null) {
- field_5 = new byte[this.field_8 * this.field_9];
- }
-
- }
-
- // $FF: renamed from: for (int) void
- public void method_0(int var1) {
- this.field_22 = (byte)var1;
- if (this.field_12 == 1) {
- this.field_15 = this.field_13 = this.field_8 / 2;
- this.field_16 = this.field_14 = this.field_9 - 5;
- this.method_6(1);
- this.field_19 = 1;
- } else {
- this.field_15 = this.field_13 = var1 * this.field_8 / 4;
- this.field_16 = this.field_14 = 5;
- this.method_6(6);
- }
-
- field_5[this.field_13 + this.field_14 * this.field_8] = this.field_22;
- this.field_20 = true;
- }
-
- // $FF: renamed from: do () void
- public void method_1() {
- this.field_20 = false;
- }
-
- // $FF: renamed from: if () boolean
- public boolean method_2() {
- return this.field_20;
- }
-
- // $FF: renamed from: int () int
- public int method_3() {
- return this.field_19;
- }
-
- // $FF: renamed from: if (int) void
- public void method_4(int var1) {
- this.field_19 = var1;
- }
-
- // $FF: renamed from: a (javax.microedition.lcdui.Graphics) void
- public void method_5(Graphics var1) {
- if (this.field_12 == 2) {
- var1.setColor(16776209);
- } else {
- var1.setColor(101, 228, 255);
- }
-
- for(int var2 = 0; var2 < this.field_19; ++var2) {
- if (this.field_12 == 2) {
- this.method_12();
- }
-
- this.field_13 += this.field_17;
- this.field_14 += this.field_18;
- var1.drawLine(this.field_13 * 3 + this.field_10, this.field_14 * 3 + this.field_11, this.field_15 * 3 + this.field_10, this.field_16 * 3 + this.field_11);
- if (field_5[this.field_13 + this.field_14 * this.field_8] != 0) {
- this.field_7.a(this);
- break;
- }
-
- field_5[this.field_13 + this.field_14 * this.field_8] = this.field_22;
- this.field_15 = this.field_13;
- this.field_16 = this.field_14;
- }
-
- }
-
- // $FF: renamed from: a (int) void
- protected void method_6(int var1) {
- byte var2 = 0;
- switch (var1) {
- case 1:
- this.field_18 = -1;
- this.field_17 = 0;
- var2 = 0;
- break;
- case 2:
- this.field_17 = -1;
- this.field_18 = 0;
- var2 = 2;
- break;
- case 5:
- this.field_17 = 1;
- this.field_18 = 0;
- var2 = 3;
- break;
- case 6:
- this.field_18 = 1;
- this.field_17 = 0;
- var2 = 1;
- break;
- case 8:
- this.field_19 = 3;
- case 3:
- case 4:
- case 7:
- default:
- return;
- }
-
- if (this.field_12 == 1) {
- this.field_21 = field_3[var2];
- } else {
- this.field_21 = field_4[var2];
- }
-
- }
-
- // $FF: renamed from: do (int) void
- protected void method_7(int var1) {
- switch (var1) {
- case 8:
- this.field_19 = 1;
- default:
- }
- }
-
- // $FF: renamed from: new () int
- public int method_8() {
- return this.field_13;
- }
-
- // $FF: renamed from: for () int
- public int method_9() {
- return this.field_14;
- }
-
- // $FF: renamed from: if (javax.microedition.lcdui.Graphics) void
- public void method_10(Graphics var1) {
- var1.setColor(16777215);
- var1.drawRect(this.field_10, this.field_11, this.field_8 * 3 - 2, this.field_9 * 3 - 2);
- var1.drawRect(this.field_10 + 1, this.field_11 + 1, this.field_8 * 3 - 4, this.field_9 * 3 - 4);
- }
-
- // $FF: renamed from: do (javax.microedition.lcdui.Graphics) void
- public void method_11(Graphics var1) {
- if (this.field_21 != null) {
- var1.drawImage(this.field_21, this.field_13 * 3 + this.field_10, this.field_14 * 3 + this.field_11, 3);
- }
- }
-
- // $FF: renamed from: a () void
- private void method_12() {
- if (field_5[this.field_13 + this.field_17 + (this.field_14 + this.field_18) * this.field_8] != 0) {
- int var1 = Math.abs(field_2.nextInt()) % 4;
- int var2 = 0;
-
- while(var2 < 4) {
- this.method_6(field_6[(var2++ + var1) % 4]);
- if (field_5[this.field_13 + this.field_17 + (this.field_14 + this.field_18) * this.field_8] == 0) {
- break;
- }
- }
-
- }
- }
-
- // $FF: renamed from: byte () void
- public void method_13() {
- int var1 = this.field_8 * this.field_9;
-
- for(int var2 = 0; var2 < var1; ++var2) {
- field_5[var2] = 0;
- }
-
- int var3 = this.field_8 * (this.field_9 - 1);
-
- for(int var4 = 0; var4 < this.field_8; ++var4) {
- field_5[var4] = 9;
- field_5[var4 + var3] = 9;
- }
-
- int var5 = this.field_8 - 1;
-
- for(int var7 = 0; var7 < this.field_9; ++var7) {
- int var6 = var7 * this.field_8;
- field_5[var6] = 9;
- field_5[var6 + var5] = 9;
- }
-
- }
-
- // $FF: renamed from: try () void
- private static void method_14() {
- try {
- field_3[0] = Image.createImage("/humanU.png");
- field_3[1] = Image.createImage("/humanD.png");
- field_3[2] = Image.createImage("/humanL.png");
- field_3[3] = Image.createImage("/humanR.png");
- field_4[0] = Image.createImage("/robotU.png");
- field_4[1] = Image.createImage("/robotD.png");
- field_4[2] = Image.createImage("/robotL.png");
- field_4[3] = Image.createImage("/robotR.png");
- } catch (Exception var1) {
- }
-
- }
-
- static {
- method_14();
- field_6 = new int[]{1, 6, 2, 5};
- }
- }
-